package cc.avatar.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * concrete slab - 混凝土板 
 * column - 条,生产是以条为单位统计
 * block - 块, 销售和库存均以块为单位统计
 * @author jchai.cn@gmail.com
 *
 */
@Entity
@Table(name="t_product") 
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Product {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	private String name;

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Override
	public boolean equals(Object o){
		if (o == null || !(o instanceof Product))
			return false;
		else
			return this.id.equals(((Product)o).getId());
	}

}
